<?php
	include 'checksession.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>新书上架</title>

	<!--通用样式-->
	<link rel="stylesheet" type="text/css" href="../css/base.css">
	
	<!--引入layui样式-->
	<link rel="stylesheet" href="../static/css/layui.css">
	
	<!--引入页面样式-->
	<link rel="stylesheet" type="text/css" href="../css/add.css">

</head>
<body>
	
	<div class="header">
		<div class="w1200">

			<ul class="layui-nav" lay-filter="">

				<li class="logo-ico"><img src="../image/logo-4.png"></li>

			  <li class="layui-nav-item"><a href="../index.html">首页</a></li>
			  <li class="layui-nav-item layui-this">
			    <a href="javascript:;">个人中心</a>
			    <dl class="layui-nav-child"> <!-- 二级菜单 -->
			      <dd><a href="center.php">个人资料</a></dd>
			      <dd><a href="list.php">图书管理</a></dd>
			      <dd><a href="../exit.html">退出系统</a></dd>
			    </dl>
			  </li>
			  <li class="layui-nav-item"><a href="">更多资源</a></li>
			</ul>

		</div>
	</div>

	<div class="container">
		<div class="body w1200">
			
			<div class="tip">
				<div class="layui-elem-quote">
				   <p class="booklist">新书上架<a href="list.php">图书列表</a></p>
				</div>
			</div>

			<div class="form-content">

				<form class="layui-form" action="add_do.php" name="myform" method="post" enctype="multipart/form-data">

					<div class="layui-form-item">
					    <label class="layui-form-label">书名</label>
					    <div class="layui-input-block">
					      <input type="text" name="bookname" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
					    </div>
					</div>
					
					<div class="layui-form-item">
					    <label class="layui-form-label">作者</label>
					    <div class="layui-input-block">
					      <input type="text" name="author" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input author">
					    </div>
					</div>

					<div class="layui-form-item">
					    <label class="layui-form-label">出版社</label>
					    <div class="layui-input-block">
					      <input type="text" name="cbs" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
					    </div>
					</div>
					
					<div class="layui-form-item">
						<label class="layui-form-label">出版日期</label>
						<div class="layui-inline"> <!-- 注意：这一层元素并不是必须的 -->
						  <input type="text" class="layui-input" name="publicdate" id="test1" autocomplete="off">
						</div>
					</div>
					
					<div class="layui-form-item">
					    <label class="layui-form-label">售价</label>
					    <div class="layui-input-block">
					      <input type="text" name="price" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input author">
					    </div>
					</div>
				
					<div class="layui-form-item">
					    <label class="layui-form-label">图书分类</label>
					    <div class="layui-input-block catagory">
					      <select name="catagory" lay-verify="required">
					        <option value=""></option>
					        <option value="7">WEB前端</option>
					        <option value="1">PHP</option>
					        <option value="2">NODEJS</option>
					        <option value="3">JAVASCRIPT</option>
					      </select>
					    </div>
					</div>
					
					<div class="layui-form-item">
						<label class="layui-form-label">开关</label>
						<div class="layui-input-block">
						  <input type="checkbox" name="switch" lay-skin="switch" value="1" checked>
						</div>
					</div>
					
					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label">图书介绍</label>
						<div class="layui-input-block">
						  <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
						</div>
					</div>
					

					<div class="layui-form-item">
					    <label class="layui-form-label">上传封面</label>

					    <button class="layui-btn" id="selectimg">
						  <i class="layui-icon">&#xe608;</i> 选择图片
						</button>

					    <input type="file" name="photo" id="photo" style="display: none;" />

						<!-- <button type="button" class="layui-btn" id="photo">
						  <i class="layui-icon">&#xe67c;</i>上传图片
						</button> -->

					</div>
					
				  <div class="layui-form-item">
				    <div class="layui-input-block">
				      <button type="submit" class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
				      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
				    </div>
				  </div>


				</form>

			</div>

		</div>
	</div>
	

	<div class="footer">
		<div class="w1200"><a href="">关于我们</a> </div>
	</div>


<!--引入JQUERY-->
<script type="text/javascript" src="../js/jquery-1.10.2.min.js"></script>

<!--引入layuijs-->
<script src="../static/layui.js"></script>

<script>

layui.use('element', function(){
  var element = layui.element;
  
  //…
});

layui.use('laydate', function(){
  var laydate = layui.laydate;
  
  //执行一个laydate实例
  laydate.render({
    elem: '#test1' //指定元素
  });
});

layui.use('form', function(){
  var form = layui.form;
 
  //监听提交
  // form.on('submit(formDemo)', function(data){
  //   layer.msg(JSON.stringify(data.field));
  //   return false;
  // });

});

layui.use('upload', function(){
  var upload = layui.upload;
   
  //执行实例
  // var uploadInst = upload.render({
  //   elem: '#photo' //绑定元素
  //   ,url: '/upload/' //上传接口
  //   ,done: function(res){
  //     //上传完毕回调
  //   }
  //   ,error: function(){
  //     //请求异常回调
  //   }
  // });

});

//选择图片,表单不提交
$("#selectimg").click(function(){
	$("#photo").click();
	return false;
})

</script>

</body>
</html>